package com.example.demo.p;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
* @description: TODO
* @author 杨镇宇
* @date 2022/3/22 14:50
* @version 1.0
*/
class A{
    private String id;
    private String name;

    public A(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
public class test {
    public static void main(String[] args) {
        List<A> list = new ArrayList(2);
        List<List<A>> list1 = new ArrayList(1);

        list.add(new A("1","2"));
        list.add(new A("11","12"));
        list1.add(list);
        List<List<String>> collect = list1.stream().map(v->v.stream().map(A::getId).collect(Collectors.toList())).collect(Collectors.toList());

    }
}
